home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1988 May & June / rerun-1988-05-06.d64 / math whiz (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  136 lines

  1. 0 rem******** math whiz ****************     ******by dan campbell**************
  2. 3 poke53280,0:poke53281,0
  3. 5 dimn$(81):dims$(3)
  4. 7 gosub1300:gosub1000
  5. 9 x=rnd(-ti)
  6. 100 poke53281,0:r=r+1:ifr>15then1200
  7. 110 print"[147][159]score: "sc"[157] "
  8. 120 a=int(rnd(1)*10)
  9. 130 a1$=n$(a)
  10. 140 b=int(rnd(1)*9)+1
  11. 150 b1$=n$(b)
  12. 160 x=a+b
  13. 170 y=a*b
  14. 180 c1$=n$(x)
  15. 190 c2$=n$(y)
  16. 200 poke198,0
  17. 300 si=val(si$)-1:onsi+1goto400,500,400,500,310,320
  18. 310 si=int(rnd(1)*2):goto330
  19. 320 si=int(rnd(1)*4)
  20. 330 onsi+1goto400,500,400,500
  21. 400 ti$="000000"
  22. 405 print""a1$s$(si)b1$e$er$
  23. 410 gosub600
  24. 415 getx$:ifx$=""then410
  25. 420 ifasc(x$)=13then700
  26. 425 ifx$<"0"orx$>"9"then410
  27. 430 print""tab(24)n$(val(x$))
  28. 435 gosub600
  29. 440 gety$:ify$=""then435
  30. 445 ifasc(y$)=20then405
  31. 450 ifasc(y$)=13then700
  32. 455 ify$<"0"ory$>"9"then435
  33. 460 print""tab(28)n$(val(y$))
  34. 465 gosub600
  35. 470 getz$:ifz$=""then465
  36. 475 ifasc(z$)=20then405
  37. 480 ifasc(z$)=13then700
  38. 485 goto465
  39. 500 ti$="000000"
  40. 505 ifsi=3then515
  41. 510 print""c1$s$(si)b1$e$er$:goto520
  42. 515 print""c2$s$(si)b1$e$er$
  43. 520 gosub600
  44. 525 getx$:ifx$=""then520
  45. 530 ifasc(x$)=13thengoto700
  46. 535 ifx$<"0"orx$>"9"then520
  47. 540 print""tab(28)n$(val(x$))
  48. 545 gosub600
  49. 550 gety$:ify$=""then545
  50. 555 ifasc(y$)=20then505
  51. 560 ifasc(y$)=13then700
  52. 565 goto545
  53. 600 tm=15-val(ti$)
  54. 610 iftm>9thenprint""tab(19)tm
  55. 620 iftm<10thenprint""tab(20)tm
  56. 630 iftm=0then800
  57. 640 return
  58. 700 onsigoto720,730,740
  59. 710 ifval(x$+y$)=xthen900
  60. 715 goto800
  61. 720 ifval(x$)=athen900
  62. 725 goto800
  63. 730 ifval(x$+y$)=ythen900
  64. 735 goto800
  65. 740 ifval(x$)=athen900
  66. 745 goto800
  67. 800 print"wrong!":sc=sc-250:f=1
  68. 805 print"[158]            [157][157][157][157][157][157][157][157][157][157][157][157]            "
  69. 810 print"            [145][157][157][157][157][157][157][157][157][157][157][157][157]";:gosub850
  70. 815 print"[159]score: "sc"[157]  "
  71. 820 pokes+4,33:pokes+1,6:pokes,71:fori=1to400:next:pokes+1,4:pokes,112
  72. 825 fori=1to750:next:pokes+1,0:pokes,0:fori=1to3500:next:pokes+4,17:goto100
  73. 850 onsigoto860,865,870
  74. 855 printa"+"b"="x:return
  75. 860 printx"-"b"="a:return
  76. 865 printa"x"b"="y:return
  77. 870 printy"/"b"="a:return
  78. 900 print"that's right!":c=1:f=0
  79. 910 p=int((900-ti)/2):sc=sc+p
  80. 920 print"[159]score: "sc"[157] "
  81. 930 restore
  82. 940 fori=1to9:readh,l,t
  83. 950 pokes+1,h:pokes,l:fory=1tot:next:pokes,0:pokes+1,0:poke53281,c:c=c+1
  84. 960 next
  85. 970 goto100
  86. 1000 n$(0)="[169] [223][157][157][157]  [157][157][157]  [157][157][157]  [157][157][157]  [157][157][157][146][223] [146][169][145][145][145][145][145]"
  87. 1010 n$(1)="[169] [157] [157] [157] [157] [157][157]   [145][145][145][145][145]"
  88. 1020 n$(2)="[169] [223][157][157][157]  [157][157][169][146][169][157][157][157][169][146][169][157][157] [157]   [145][145][145][145][145]"
  89. 1030 n$(3)="[169] [223][157][157][157]  [157][157][146][162][169][157][157][162][223][157][157][157][146][162] [157][157][157][146][223] [146][169][145][145][145][145][145]"
  90. 1040 n$(4)=" [146][182][182][157][157][157] [146][182][182][157][157][157]   [157][157][146][182][182][157][157][146][182][182][157][157][146][182][182][145][145][145][145][145]"
  91. 1050 n$(5)="   [157][157][157] [157]  [223][157] [157][157][157][184] [157][157][157][146][223] [146][169][145][145][145][145][145]"
  92. 1060 n$(6)="[169] [223][157][157][157] [162][157][157][157]  [223][157][157][157]  [157][157][157]  [157][157][157][146][223] [146][169][145][145][145][145][145]"
  93. 1070 n$(7)="   [157][157][157][162] [157][157][169][146][169][157][157] [157] [157] [145][145][145][145][145]"
  94. 1080 n$(8)="[169] [223][157][157][157]  [157][157][157][146][223][162][169][157][157][157][169][162][223][157][157][157]  [157][157][157][146][223] [146][169][145][145][145][145][145]"
  95. 1090 n$(9)="[169] [223][157][157][157]  [157][157][157]  [157][157][157][146][223]  [157][157][157][184] [157][157][157][146][223] [146][169][145][145][145][145][145]"
  96. 1100 fori=10to81:n$(i)=n$(int(i/10))+n$(i-(int(i/10)*10)):next
  97. 1110 r$="       [157][157][157][157][157][157][157]":fori=1to6:er$=er$+r$:next
  98. 1120 s$(0)="[146][186][204][157][157][208][207][145][145][145]"
  99. 1130 s$(1)="[146][164][164][157][157][163][163][145][145][145]"
  100. 1140 s$(2)="[146][205][206][157][157][206][205][145][145][145]"
  101. 1150 s$(3)="[146][209][157][157][195][195][195][157][157][209][145][145][145][145]"
  102. 1160 e$="[146][192][192][157][157][192][192][145][145][145]"
  103. 1170 return
  104. 1200 print"[147][159]score: "sc"[157]  "
  105. 1210 l1=27:iff=1thenrestore:l1=36
  106. 1220 fori=1tol1:readh,l,t
  107. 1230 pokes+1,h:pokes,l:fory=1tot+20:next
  108. 1240 pokes+1,0:pokes,0:next
  109. 1260 print"[158]             to play again[157][157][157][157][157][157][157][157][157]press[157][157][157]a[146]"
  110. 1270 getf$:iff$<>"a"then1270
  111. 1280 gosub1325:goto100
  112. 1300 print"[147][159]****************math whiz[146]***************"
  113. 1310 print"              press any key":print" to begin"
  114. 1320 getg$:ifg$=""then1320
  115. 1325 print"[147][159]1[146] add"
  116. 1330 print"2[146] subtract"
  117. 1335 print"3[146] multiply"
  118. 1340 print"4[146] divide"
  119. 1345 print"5[146] add & subtract"
  120. 1350 print"6[146] all functions"
  121. 1355 print:print:input"";si$
  122. 1360 s=54272:fori=stos+24:pokei,0:next:pokes+5,96
  123. 1365 pokes+6,255:pokes+24,15:pokes+4,17
  124. 1370 sc=0:r=0
  125. 1375 ifval(si$)=>1andval(si$)<=6then1385
  126. 1380 goto1325
  127. 1385 return
  128. 1500 data50,60,100,50,60,100,50,60,100,50,60,200,63,75,100
  129. 1510 data75,69,100,75,69,100,63,75,100,50,60,200
  130. 1520 data50,60,100,56,99,100,56,99,100,56,99,100,56,99,200
  131. 1530 data50,60,100,47,107,100,47,107,100,42,62,100,37,162,300
  132. 1540 data50,60,100,50,60,100,50,60,100,50,60,200
  133. 1550 data63,75,100,75,69,100,75,69,100,63,75,100,50,60,200
  134. 1560 data50,60,100,56,99,200,56,99,100,37,162,100
  135. 1570 data42,62,100,47,107,100,50,60,500,50,60,400
  136.